package com.yiming.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 曾衣铭
 * @Date: 2020/09/26/15:49
 * @Description:
 */
@RestController
public class Server2Controller {
    @Value("${server.port}")
    private String port;

    @GetMapping("/add")
    public String add(int x, int y){
        System.out.println("当前服务器端口是:"+port);
        return "sum="+x+y+""+"=>服务端口号是："+port;
    }
}
